<!--培育计划管理-->
<template>
    <div>
        <page-header title="培育计划管理" content="Cultivation plan" />
        <page-main>
            <h2>请选择相应的专业</h2>
            <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="60px"
                     label-position="left"
            >
                <el-row :gutter="50">
                    <el-col :xs="24" :sm="16" :md="10" :lg="6" :xl="6">
                        <el-form-item label="院系:" prop="field102">
                            <el-select v-model="formData.field102" placeholder="请选择院系" clearable :style="{width: '100%'}" @change="findAll_Major">
                                <el-option v-for="(item, index) in field102Options" :key="index" :label="item.department_name"
                                           :value="item.id" :disabled="item.disabled"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="16" :md="10" :lg="6" :xl="6">
                        <el-form-item label="专业:" prop="field101">
                            <el-select v-model="formData.field101" placeholder="请选择专业" clearable :style="{width: '100%'}" @change="change_Major">
                                <el-option v-for="(item, index) in field101Options" :key="index" :label="item.major_name"
                                           :value="item.id" :disabled="item.disabled"
                                />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="16" :md="10" :lg="6" :xl="6" :push="show?0:2">
                        <el-form-item>
                            <el-button type="primary" @click="add_cultivation_plan">添加新的培育计划</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <page-main title="培育计划:" />
            <el-divider content-position="left">大一</el-divider>
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card  header="大一（上学期）" style="font-size: 30px; color: #409eff;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            v-model="tableData"
                            :data="tableData"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大一（下学期）" style="font-size: 30px; color: #ffb86c;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            v-if="isRouterAlive"
                            :key="show"
                            ref="refTable"
                            :data="tableData2"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :expand-row-keys="expands"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.id)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row.id)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
            </el-row>
            <el-divider content-position="left">大二</el-divider>
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大二（上学期）" style="font-size: 30px; color: #409eff;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData3"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大二（下学期）" style="font-size: 30px; color: #ffb86c;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData4"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
            </el-row>
            <el-divider content-position="left">大三</el-divider>
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大三（上学期）" style="font-size: 30px; color: #409eff;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData5"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大三（下学期）" style="font-size: 30px; color: #ffb86c;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData6"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
            </el-row>
            <el-divider content-position="left">大四</el-divider>
            <el-row :gutter="20">
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大四（上学期）" style="font-size: 30px; color: #409eff;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData7"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
                <el-col :xs="24" :sm="24" :md="18" :lg="18" :xl="11">
                    <el-card header="大四（下学期）" style="font-size: 30px; color: #ffb86c;">
                        <!--table需要的data：screenWidth、show-->
                        <el-table
                            :key="show"
                            ref="refTable"
                            :data="tableData8"
                            style="width: 100%;"
                            tooltip-effect="dark"
                            :border="true"
                            :row-key="show?getRowKey:''"
                            @row-click="clickTable"
                        >
                            <el-table-column v-if="!show" type="expand">
                                <template slot-scope="props">
                                    <el-form label-position="left" inline class="demo-table-expand">
                                        <el-row>
                                            <el-col :span="24">
                                                <el-form-item label="课程名称:">
                                                    <span>{{ props.row.course_name }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="24">
                                                <el-form-item label="课程性质:">
                                                    <span>{{ props.row.course_nature }}</span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="6" :push="6">
                                                <el-button
                                                    size="mini"
                                                    type="danger"
                                                    @click="handleDelete(props.row.course_name)"
                                                >
                                                    删除
                                                </el-button>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </template>
                            </el-table-column>
                            <!--<el-table-column-->
                            <!--    v-if="show"-->
                            <!--    type="selection"-->
                            <!--    min-width="55"-->
                            <!--    align="center"-->
                            <!--/>-->
                            <el-table-column
                                v-if="show"
                                label="序号"
                                width="50"
                                type="index"
                                :index="indexMethod"
                                align="center"
                            />
                            <el-table-column
                                prop="course_name"
                                label="课程名称"
                                min-width="150"
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                prop="course_nature"
                                label="课程性质"
                                min-width="100"
                                show-overflow-tooltip
                                align="center"
                            />
                            <el-table-column
                                v-if="show"
                                label="操作"
                                width="200"
                                align="center"
                            >
                                <template slot-scope="props">
                                    <el-button
                                        size="mini"
                                        type="danger"
                                        @click="handleDelete(props.row)"
                                    >
                                        删除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-card>
                </el-col>
            </el-row>
        </page-main>
    </div>
</template>
<script>
import PageMain from '../../components/PageMain/index'
import api from '../../api'
import {Message} from 'element-ui'
export default {
    name: 'cultivation.plan',
    components: {PageMain},
    inheritAttrs: false,
    props: [],
    data() {
        return {
            // 要展开的行，数值的元素是row的key值
            expands: [],
            formData: {
                field102: 124,
                field101: 0
            },
            rules: {
                field102: [{
                    required: true,
                    message: '请选择院系',
                    trigger: 'change'
                }],
                field101: [{
                    required: true,
                    message: '请选择专业',
                    trigger: 'change'
                }]
            },
            field101Options: [],
            field102Options: [],
            tableData: [{}],
            tableData2: [{}],
            tableData3: [{}],
            tableData4: [{}],
            tableData5: [{}],
            tableData6: [{}],
            tableData7: [{}],
            tableData8: [{}],
            screenWidth: window.innerWidth, // 浏览器宽度
            show: true, // 判断条件
            isRouterAlive: true
        }
    },
    computed: {
        isEdit() {
            return this.$store.state.settings.mode // 需要监听的数据
        }
    },
    watch: {
        isEdit() {
            if (this.$store.state.settings.mode == 'mobile') {
                this.show = false
            } else {
                this.show = true
            }
        },
        'formData.field101': {
            // 对数据进行深度监听，如果数据发生变化，就获取培育计划表中的数据并渲染到表格上
            handler: function() {
                var _this = this
                this.tableData = []
                this.tableData2 = []
                this.tableData3 = []
                this.tableData4 = []
                this.tableData5 = []
                this.tableData6 = []
                this.tableData7 = []
                this.tableData8 = []
                api.post('cultivationPlan/findByMajor', {
                    data: this.formData.field101})
                    .then(res => {
                        _this.tableData = res.data['大一（上学期）']
                        _this.tableData2 = res.data['大一（下学期）']
                        _this.tableData3 = res.data['大二（上学期）']
                        _this.tableData4 = res.data['大二（下学期）']
                        _this.tableData5 = res.data['大三（上学期）']
                        _this.tableData6 = res.data['大三（下学期）']
                        _this.tableData7 = res.data['大四（上学期）']
                        _this.tableData8 = res.data['大四（下学期）']
                    })
            },
            deep: true
        }
    },
    created() {
        if (this.$store.state.settings.mode == 'mobile') {
            this.show = false
        } else {
            this.show = true
        }
        var _this = this
        api.post('department/findAll').then(res => {
            _this.field102Options = res.data
        })
        api.post('major/findByDepartmentID', {
            data: this.formData.field102})
            .then(res => {
                this.field101Options = res.data
                this.formData.field101 = res.data[0].id
            })

    },
    mounted() {
    },
    methods: {
        indexMethod(index) {
            return index + 1
        },
        // eslint-disable-next-line no-unused-vars
        clickTable(row, index, e) {
            console.log(row.course_name)
            this.$refs.refTable.toggleRowExpansion(row)
        },
        getRowKey(row) {
            return row.staffTypeId
        },
        findAll_Major() {
            this.tableData = []
            this.tableData2 = []
            this.tableData3 = []
            this.tableData4 = []
            this.tableData5 = []
            this.tableData6 = []
            this.tableData7 = []
            this.tableData8 = []
            var _this = this
            api.post('major/findByDepartmentID', {
                data: this.formData.field102})
                .then(res => {
                    _this.field101Options = res.data
                    _this.formData.field101 = res.data[0].id
                })
        },
        reload() {

        },
        handleDelete(row) {
            this.$confirm('此操作将永久删除该培育计划, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                api.post('cultivationPlan/deleteCultivationPlan', {
                    data: row})
                    .then(res => {
                        Message.error(res.msg)
                        location.reload()
                    })
            }).catch(() => {
                this.$message({
                    type: 'info',
                    message: '已取消删除'
                })
            })

        },
        change_Major() {
            this.tableData = []
            this.tableData2 = []
            this.tableData3 = []
            this.tableData4 = []
            this.tableData5 = []
            this.tableData6 = []
            this.tableData7 = []
            this.tableData8 = []
            var _this = this
            api.post('cultivationPlan/findByMajor', {
                data: this.formData.field101})
                .then(res => {
                    _this.tableData = res.data['大一（上学期）']
                    _this.tableData2 = res.data['大一（下学期）']
                    _this.tableData3 = res.data['大二（上学期）']
                    _this.tableData4 = res.data['大二（下学期）']
                    _this.tableData5 = res.data['大三（上学期）']
                    _this.tableData6 = res.data['大三（下学期）']
                    _this.tableData7 = res.data['大四（上学期）']
                    _this.tableData8 = res.data['大四（下学期）']
                })
        },
        add_cultivation_plan() {
            // 跳转路径
            this.$router.push({path: '/school/add_cultivation_plan'})
        }
    }
}
</script>

<style lang="scss" scoped>
    .table-pc-style {
        width: 80%;
    }
    .table-mobile-style {
        width: 100%;
    }
</style>

